//
//  DAUEngineBaseTVC.m
//  DAU-iOS
//
//  Created by XiangDongMBP on 2016/11/17.
//  Copyright © 2016年 East. All rights reserved.
//

#import "DAUEngineBaseTVC.h"

@interface DAUEngineBaseTVC ()

@property (nonatomic, strong) UIImage *warningImg;
@property (nonatomic, strong) UIImage *normalImg;

@end

NSString * const kCellIdentifier = @"UITableViewCell";

@implementation DAUEngineBaseTVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.warningImg = [UIImage imageNamed:@"engine_warning"];
    self.normalImg = [UIImage imageNamed:@"engine_normal"];
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kCellIdentifier];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)configureCell:(UITableViewCell *)cell forProduct:(DAUEngineRoomItem *)item {
    cell.imageView.image = (item.state == 0) ? self.normalImg : self.warningImg;
    cell.textLabel.font = [UIFont systemFontOfSize:14];
    cell.textLabel.textColor = DAU_COLOR_FontNor(1.0);
    cell.textLabel.text = item.name;
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}

@end
